class Solution
{
public:
    double minimumAverage(vector<int> &nums)
    {
        double result = 1e9;
        sort(nums.begin(), nums.end());
        int n = nums.size();
        for (int i = 0; i < n / 2; ++i)
        {
            result = min(result, (nums[i] + nums[n - 1 - i]) / 2.0);
        }
        return result;
    }
};